<template>
  <demoBlock title="上传前置处理" padding>
    <vcu-uploader :before-read="beforeRead" />
  </demoBlock>
</template>

<script>
import { defineComponent, ref } from "vue";
import { Toast } from "../../../components";
export default defineComponent({
  setup() {
    const beforeRead = (file) => {
      if (file.type !== "image/jpeg") {
        Toast("请上传 jpg 格式图片");
        return false;
      }
      return true;
    };

    return {
      beforeRead,
    };
  },
});
</script>
